﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DataAccess;
namespace QLDSVCNTT_Nhom1
{
    public partial class FrmBackup : Form
    {
        public FrmBackup()
        {
            InitializeComponent();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
           
        }

        private void btnBackup_Click(object sender, EventArgs e)
        {
            
            saveFileDialog.Filter = "Backup File(*.bak)|*.bak";
            saveFileDialog.FileName = "";
            saveFileDialog.Title = "Save to...";
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                
                Backup bk = new Backup(System.IO.Path.GetDirectoryName(saveFileDialog.FileName), System.IO.Path.GetFileName(saveFileDialog.FileName));
                int num = Backup.backup(bk);
                if (num !=0)
                {
                    MessageBox.Show("Backup thanh cong", "Thông báo");
                    this.Close();
                }
            }
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        
    }
}
